# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.shortcuts import render

from django.http import HttpResponse

from django.urls import reverse
# Create your views here.
 
 #http://127.0.0.1:8000/add/?a=4&b=5
 #以add/?a=4&b=5方式传递a,b参数
def add(request):
    a = request.GET['a']
    b = request.GET['b']
    c = int(a)+int(b)
    return HttpResponse(str(c))
#http://127.0.0.1:8000/add/4/5/
#以add/4/5/方式传递a,b参数
def add2(request, a, b):
    c = int(a) + int(b)
    return HttpResponse(str(c))

def index(request):
    return render(request, 'home.html')


